#ifndef __GLOBALMESSAGE_H_
#define __GLOBALMESSAGE_H_


#include <stdbool.h>

#define NameSize 20
#define ContentSize 1024
//在线用户结构体
struct ClientInfo
{
    char ClientName[NameSize];
    int sock;
};
typedef struct ClientInfo CInfo;

CInfo* CreateCInfo(const char *name,int sock);
void PrintCInfo(void *p);
bool IsClientNameEqual(void *ClientPtr,void* clientName);
bool IsClientSockEqual(void *ClientPtr,void* sock);



enum Request
{
    LOGIN = -2, //登录
    SIGNUP = -1,//注册
    CHAT=1, //私聊
    BROADCAST, //广播
    ONLINELIST, //在线列表
    SENDFILE,  //发送文件
    MYCLOUD, //我的网盘

    FILELIST = 128 , //查看网盘文件列表
    UPLOAD,//上传
    DOWNLOAD //下载
};
//信息结构体
struct GlobalMessage
{
    char FromName[NameSize]; //信息来源
    char ToName[NameSize];  //信息目标
    char Content[ContentSize]; //信息主体
    int flag; //功能标志位
};

typedef struct GlobalMessage MSG;

#endif